function logout() {
    try {
        localStorage.removeItem('token');
        localStorage.removeItem('userInfo');
    } catch (e) {}
    window.location.href = '/';
}